using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._FromWFS
{
    /// <summary>
    /// <para>WFS To Feature Class</para>
    /// <para>Imports a feature type from a web feature service (WFS) to a feature class in a geodatabase.</para>
    /// <para>将要素类型从 Web 要素服务 （WFS） 导入到地理数据库中的要素类。</para>
    /// </summary>    
    [DisplayName("WFS To Feature Class")]
    public class WFSToFeatureClass : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public WFSToFeatureClass()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_WFS_server">
        /// <para>WFS Server</para>
        /// <para>The URL of the source WFS service (for example, http://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WFSServer?). If the input is a complex WFS service (Complex WFS service is checked), this can also be the path to the XML file.</para>
        /// <para>源 WFS 服务的 URL（例如，http://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WFSServer？）。如果输入是复杂 WFS 服务（选中了复杂 WFS 服务），则这也可以是 XML 文件的路径。</para>
        /// </param>
        /// <param name="_WFS_feature_type">
        /// <para>Select Feature Type to Extract</para>
        /// <para>The name of the WFS layer to extract from the input WFS service.</para>
        /// <para>要从输入 WFS 服务中提取的 WFS 图层的名称。</para>
        /// </param>
        /// <param name="_out_path">
        /// <para>Output Location</para>
        /// <para><xdoc>
        ///   <para>The location of the output feature class or geodatabase.</para>
        ///   <para>If the input is a simple WFS service, the output location can be a geodatabase or a feature dataset in a geodatabase. If the output location is a feature dataset, the coordinates are converted from the source coordinate system to the coordinate system of the feature dataset.</para>
        ///   <para>If the input is a complex WFS service, the output location must be a folder.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出要素类或地理数据库的位置。</para>
        ///   <para>如果输入是简单的 WFS 服务，则输出位置可以是地理数据库或地理数据库中的要素数据集。如果输出位置为要素数据集，则坐标将从源坐标系转换为要素数据集的坐标系。</para>
        ///   <para>如果输入是复杂的 WFS 服务，则输出位置必须是文件夹。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_name">
        /// <para>Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output feature class or geodatabase.</para>
        ///   <para>If the input is a simple WFS service, the name is used to create a feature class in the output location. If the feature class name already exists in the geodatabase, the name will be automatically incremented. By default, the feature type name is used.</para>
        ///   <para>If the input is a complex WFS service, the name is used to create a geodatabase in the output location.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出要素类或地理数据库的名称。</para>
        ///   <para>如果输入是简单的 WFS 服务，则该名称将用于在输出位置创建要素类。如果地理数据库中已存在要素类名称，则该名称将自动递增。默认情况下，使用要素类型名称。</para>
        ///   <para>如果输入是复杂的 WFS 服务，则该名称将用于在输出位置创建地理数据库。</para>
        /// </xdoc></para>
        /// </param>
        public WFSToFeatureClass(object _input_WFS_server, object _WFS_feature_type, object _out_path, object _out_name)
        {
            this._input_WFS_server = _input_WFS_server;
            this._WFS_feature_type = _WFS_feature_type;
            this._out_path = _out_path;
            this._out_name = _out_name;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "WFS To Feature Class";

        public override string CallName => "conversion.WFSToFeatureClass";

        public override List<string> AcceptEnvironments => ["configKeyword", "extent"];

        public override object[] ParameterInfo => [_input_WFS_server, _WFS_feature_type, _out_path, _out_name, _out_feature_class, _is_complex.GetGPValue(), _out_gdb, _max_features, _expose_metadata.GetGPValue(), _swap_xy.GetGPValue()];

        /// <summary>
        /// <para>WFS Server</para>
        /// <para>The URL of the source WFS service (for example, http://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WFSServer?). If the input is a complex WFS service (Complex WFS service is checked), this can also be the path to the XML file.</para>
        /// <para>源 WFS 服务的 URL（例如，http://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WFSServer？）。如果输入是复杂 WFS 服务（选中了复杂 WFS 服务），则这也可以是 XML 文件的路径。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("WFS Server")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_WFS_server { get; set; }


        /// <summary>
        /// <para>Select Feature Type to Extract</para>
        /// <para>The name of the WFS layer to extract from the input WFS service.</para>
        /// <para>要从输入 WFS 服务中提取的 WFS 图层的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Select Feature Type to Extract")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _WFS_feature_type { get; set; }


        /// <summary>
        /// <para>Output Location</para>
        /// <para><xdoc>
        ///   <para>The location of the output feature class or geodatabase.</para>
        ///   <para>If the input is a simple WFS service, the output location can be a geodatabase or a feature dataset in a geodatabase. If the output location is a feature dataset, the coordinates are converted from the source coordinate system to the coordinate system of the feature dataset.</para>
        ///   <para>If the input is a complex WFS service, the output location must be a folder.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出要素类或地理数据库的位置。</para>
        ///   <para>如果输入是简单的 WFS 服务，则输出位置可以是地理数据库或地理数据库中的要素数据集。如果输出位置为要素数据集，则坐标将从源坐标系转换为要素数据集的坐标系。</para>
        ///   <para>如果输入是复杂的 WFS 服务，则输出位置必须是文件夹。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Location")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_path { get; set; }


        /// <summary>
        /// <para>Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output feature class or geodatabase.</para>
        ///   <para>If the input is a simple WFS service, the name is used to create a feature class in the output location. If the feature class name already exists in the geodatabase, the name will be automatically incremented. By default, the feature type name is used.</para>
        ///   <para>If the input is a complex WFS service, the name is used to create a geodatabase in the output location.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出要素类或地理数据库的名称。</para>
        ///   <para>如果输入是简单的 WFS 服务，则该名称将用于在输出位置创建要素类。如果地理数据库中已存在要素类名称，则该名称将自动递增。默认情况下，使用要素类型名称。</para>
        ///   <para>如果输入是复杂的 WFS 服务，则该名称将用于在输出位置创建地理数据库。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_name { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Complex WFS service</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the input WFS service is a complex WFS service.
        ///   <bulletList>
        ///     <bullet_item>Checked—The WFS service is a complex WFS service.  </bullet_item><para/>
        ///     <bullet_item>Not checked—The WFS service is not a complex service. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定输入 WFS 服务是否为复杂 WFS 服务。
        ///   <bulletList>
        ///     <bullet_item>选中 - WFS 服务是一个复杂的 WFS 服务。</bullet_item><para/>
        ///     <bullet_item>未选中 - WFS 服务不是复杂服务。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Complex WFS service")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_complex_value _is_complex { get; set; } = _is_complex_value._false;

        public enum _is_complex_value
        {
            /// <summary>
            /// <para>COMPLEX</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("COMPLEX")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_COMPLEX</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_COMPLEX")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_gdb { get; set; }


        /// <summary>
        /// <para>Max Features</para>
        /// <para>The maximum number of features that can be returned. The default is 1000.</para>
        /// <para>可返回的最大要素数。默认值为 1000。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Max Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _max_features { get; set; } = 1000;


        /// <summary>
        /// <para>Expose Metadata</para>
        /// <para><xdoc>
        ///   <para>Specifies whether tables with metadata will be created from the service. This is only applicable for complex WFS services.
        ///   <bulletList>
        ///     <bullet_item>Checked—Metadata tables will be created in the output geodatabase.  </bullet_item><para/>
        ///     <bullet_item>Not checked—Metadata tables will not be created in the output geodatabase. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是否从服务创建包含元数据的表。这仅适用于复杂的 WFS 服务。
        ///   <bulletList>
        ///     <bullet_item>选中 - 将在输出地理数据库中创建元数据表。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会在输出地理数据库中创建元数据表。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Expose Metadata")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _expose_metadata_value _expose_metadata { get; set; } = _expose_metadata_value._false;

        public enum _expose_metadata_value
        {
            /// <summary>
            /// <para>EXPOSE_METADATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("EXPOSE_METADATA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_EXPOSE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_EXPOSE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Swap XY Axis Order</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the x,y axis order of the output feature class will be swapped. Some WFS services may have the order of the x,y coordinates swapped on the server side, causing the feature class to display incorrectly.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Checked—The x,y axis order will be swapped.</bullet_item><para/>
        ///       <bullet_item>Not checked—The x,y axis order will not be swapped. This is the default.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否交换输出要素类的 x，y 轴顺序。某些 WFS 服务可能在服务器端交换了 x，y 坐标的顺序，从而导致要素类显示不正确。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>选中 - 将交换 x，y 轴顺序。</bullet_item><para/>
        ///       <bullet_item>未选中 - 不会交换 x，y 轴顺序。这是默认设置。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Swap XY Axis Order")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _swap_xy_value _swap_xy { get; set; } = _swap_xy_value._false;

        public enum _swap_xy_value
        {
            /// <summary>
            /// <para>SWAP_XY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SWAP_XY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_SWAP_XY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_SWAP_XY")]
            [GPEnumValue("false")]
            _false,

        }

        public WFSToFeatureClass SetEnv(object configKeyword = null, object extent = null)
        {
            base.SetEnv(configKeyword: configKeyword, extent: extent);
            return this;
        }

    }

}